# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.CloudChannel.V1.Model.GoogleCloudChannelV1ParameterDefinition do
  @moduledoc """
  Parameter's definition. Specifies what parameter is required to use the current Offer to purchase.

  ## Attributes

  *   `allowedValues` (*type:* `list(GoogleApi.CloudChannel.V1.Model.GoogleCloudChannelV1Value.t)`, *default:* `nil`) - If not empty, parameter values must be drawn from this list. For example, [us-west1, us-west2, ...] Applicable to STRING parameter type.
  *   `maxValue` (*type:* `GoogleApi.CloudChannel.V1.Model.GoogleCloudChannelV1Value.t`, *default:* `nil`) - Maximum value of the parameter, if applicable. Inclusive. For example, maximum seats when purchasing Google Workspace Business Standard. Applicable to INT64 and DOUBLE parameter types.
  *   `minValue` (*type:* `GoogleApi.CloudChannel.V1.Model.GoogleCloudChannelV1Value.t`, *default:* `nil`) - Minimal value of the parameter, if applicable. Inclusive. For example, minimal commitment when purchasing Anthos is 0.01. Applicable to INT64 and DOUBLE parameter types.
  *   `name` (*type:* `String.t`, *default:* `nil`) - Name of the parameter.
  *   `optional` (*type:* `boolean()`, *default:* `nil`) - If set to true, parameter is optional to purchase this Offer.
  *   `parameterType` (*type:* `String.t`, *default:* `nil`) - Data type of the parameter. Minimal value, Maximum value and allowed values will use specified data type here.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :allowedValues =>
            list(GoogleApi.CloudChannel.V1.Model.GoogleCloudChannelV1Value.t()) | nil,
          :maxValue => GoogleApi.CloudChannel.V1.Model.GoogleCloudChannelV1Value.t() | nil,
          :minValue => GoogleApi.CloudChannel.V1.Model.GoogleCloudChannelV1Value.t() | nil,
          :name => String.t() | nil,
          :optional => boolean() | nil,
          :parameterType => String.t() | nil
        }

  field(:allowedValues, as: GoogleApi.CloudChannel.V1.Model.GoogleCloudChannelV1Value, type: :list)

  field(:maxValue, as: GoogleApi.CloudChannel.V1.Model.GoogleCloudChannelV1Value)
  field(:minValue, as: GoogleApi.CloudChannel.V1.Model.GoogleCloudChannelV1Value)
  field(:name)
  field(:optional)
  field(:parameterType)
end

defimpl Poison.Decoder,
  for: GoogleApi.CloudChannel.V1.Model.GoogleCloudChannelV1ParameterDefinition do
  def decode(value, options) do
    GoogleApi.CloudChannel.V1.Model.GoogleCloudChannelV1ParameterDefinition.decode(value, options)
  end
end

defimpl Poison.Encoder,
  for: GoogleApi.CloudChannel.V1.Model.GoogleCloudChannelV1ParameterDefinition do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
